﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using RoadTeam.Enums;
using System.Data;

namespace RoadTeam.SysInterface
{

    public static partial class FactoryClass
    {
        private static RoadTeam.SysInterface.ICsListItem _iCsListItem = null;
        /// <summary>
        /// 获取ICsListItem实现业务的实例
        /// </summary>
        /// <returns>IConfig</returns>
        public static ICsListItem CreateCsListItem()
        {
            if (_iCsListItem == null)
            {
                string className = GlobalConfig.RtSystemPath + ".CS.CsListItem";
                _iCsListItem = (ICsListItem)Assembly.Load(GlobalConfig.RtSystemPath).CreateInstance(className);
            }
            return _iCsListItem;
        }
    }


    public interface ICsListItem
    {
        /// <summary>
        /// 获取乐天系统数据库中的项目数据
        /// </summary>
        /// <returns></returns>
        DataTable GetAllCsListItemFromRoadTeamSystem();

        /// <summary>
        ///   更新乐天数据库中的项目数据
        /// </summary>
        /// <param name="dt">需要更新的数据库表</param>
        /// <returns></returns>
        bool UpdateCsListItemToRoadTeamSystem(DataTable dt);


        /// <summary>
        ///  根据APP编号获取项目ID
        /// </summary>
        /// <param name="Identifier">APP编号</param>
        /// <returns></returns>
        int GetCsListItemIDFromSystem(String Identifier);
    }
}
